1. Field of the Invention
The present invention relates to an image processing device in which, when performing cut and paste editing of a first image on a second image, the first image has undergone pixel blocking operations for compression and expansion, and the second image pasted with the first image will also undergo pixel blocking operations for compression and expansion.
2. Description of the Related Art
Recently JPEG (Joint Photographic Expert Group) recommended a standardization algorithm for encoding images in units of blocks of 4.times.4 pixels, 8.times.8 pixels, etc. This is an algorithm for image data encoding and decoding, i.e., data compression and expansion for color still images and gray-scale still images.
The basic system of the algorithm is irreversible transformation of compression and expansion. For compression, discrete cosine transformation (DCT), quantization and entropy encoding are carried out in sequence. For expansion, on the other hand, entropy decoding, reverse quantization and reverse DCT are carried out in sequence. Some other encoding systems using DCT have been proposed (see, as an example, Japanese Patent Application KOKAI Publication No. 3-256454). DCT is a well-known technique described in, for example, NIKKEI ELECTRONICS, Oct. 15, 1990, (no. 511) pp 124 to 129. In JPEG system the images are encoded in units of blocks each of which is constituted by a block of m.times.n pixels. The encoding is performed for each block. In this specification, explanation is made of a block of m=8, n=8. In the JPEG basic system, which is an irreversible transformation system, even if the processes of compression, retention and expansion are repeated for the same image, no degradation of the quality of a reencoded image will occur as long as the block boundaries for dividing image pixels into blocks remain unchanged.
However, problems arise when an attempt is made to further compress and retain a composite image formed by cut and paste editing of compressed, expanded images. Assuming that a first image is blocked in units of 8.times.8 pixels for subsequent compression. To cut out an image from the first image, the size of 4 blocks.times.5 blocks, from the blocked first image, it will be cut out along the block boundaries for coding as shown. After the cut image has been pasted on a second image, the resultant composite image is divided into blocks when compressed by reencoding. In this case, the block boundaries of the pasted image will not coincide with the block boundaries of the composite image. The reason for this is that, in pasting the cut image on the second image, their block boundaries are invisible to an operator. If it happened that the block boundaries of the images coincided and the scale factors of the images were identical to each other, no image quality degradation due to reencoding would occur. If, however, cut and paste editing were performed in a state where the block boundaries of the images do not coincide with each other, then the image quality would degrade with each repetition of the processes of cut and paste editing, compression, retention, and expansion.
Consider now the phase of a coordinate position at each block boundary of the cut and paste image with respect to the block boundaries of the second image. When the first and second images and are not coincident with each other in block boundary, i.e., phase before and after cut and paste, such image quantity degradation as described above will occur. Note here that, when one block for coding has a size of 8 pixels.times.8 pixels, the phase is represented by the lower-order three bits of the X, Y coordinates of each pixel of the first image within each block of the second image and takes values from (0, 0) to (7, 7) each represented by three bits. Here, (0, 0) and (7, 7) indicate phase positions.